home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-03-13 | 36.5 KB | 1,212 lines |
- <!--//--><script language="javascript">
- /*
- File Dependencies:
- objDL.js The DHTML Library (dl)
- objTI.js The TKM Installer (ti)
- objRO.js The Request Object (ro) - This is included here to provide support for the objTI.js
- objPC.js The PluginChecker(2).dll Script Wrapper (pc)
- objTU.js The tkmUpdater script wrapper
- [geo]\constants.js The localized constants that are called in this file.
-
- Required Initialization Method:
- EYPC_Init Shows the appropriate UI based on the installation status
- */
-
-
- // #### BEGIN g_sTKMRoot DEFINITION ####
- // Start at the beginning of the location and find our document root directory
- var g_sHref = location.href.toLowerCase();
- var g_nEndPos = g_sHref.indexOf('outfitter/');
- // Grab everything up to the end of the word outfitter and add "/tkm/" to set the TKM Root
- var g_sTKMRoot = g_sHref.substring(0, (g_nEndPos + 9)) + '/tkm/';
- // Move past the "outfitter/" string and start looking for the geo/lang
- var g_nBeginGeo = g_nEndPos + 10;
- // Find the next "/" and we have the geo/lang
- var g_nEndGeo = g_sHref.indexOf('/', g_nBeginGeo);
- // Parse out the geo/lang so we know what to use
- var g_sGeo = g_sHref.substring(g_nBeginGeo, g_nEndGeo);
- // #### END g_sTKMRoot DEFINITION ####
-
- // #### BEGIN OS SNIFFER ###
- var agt=navigator.userAgent.toLowerCase();
-
- if(((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1))) g_sOS = "WIN98";
- else if(((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1))) g_sOS = "WIN2000";
- // #### END OS SNIFFER ###
-
- /* #### BEGIN ADD DEPENDENCIES #### */
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objDL.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objRO.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objTI.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objTU.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objPC.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objWTUI.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scenarios/eypc/' + g_sGeo + '/constants.js">');
- document.write('\n<' + '/script>\n');
- // #### END ADD DEPENDENCIES ####
-
- function EYPC()
- {
- // Accessory Items (Tools)
- this.g_AIs = new Array(0);
- this.AICount = new Number(0);
- this.AddAI = EYPC_AddAI;
-
- // Accessory Item Dependencies (Tools)
- this.g_AIDeps = new Array(0);
- this.AIDepCount = new Number(0);
- this.AddAIDep = EYPC_AddAIDep;
-
- // Functions for manipulating the SCREEN objects
- this.g_Screens = new Array(0);
- this.ScreenCount = new Number(0);
- this.AddScreen = EYPC_AddScreen;
- this.ShowScreen = EYPC_ShowScreen;
- this.HideScreen = EYPC_HideScreen;
- this.SwitchScreens = EYPC_SwitchScreens;
-
- // Helper functions
- this.ConvertKBtoMB = EYPC_ConvertKBtoMB;
-
- // UI Methods
- this.DefineScreens = EYPC_DefineScreens;
- this.SelectAllAI = EYPC_SelectAllAI;
- this.BtnContinue = EYPC_BtnContinue;
- this.BtnGoBack = EYPC_BtnGoBack;
- this.BtnStartInstall = EYPC_BtnStartInstall;
- this.ChkUpdateTotalSize = EYPC_ChkUpdateTotalSize;
- this.IsInInstallString = EYPC_IsInInstallString;
- this.CheckAIs = EYPC_CheckAIs;
- this.GetAIInfo = EYPC_GetAIInfo;
- this.InstallAIs = EYPC_InstallAIs;
- this.PollAndSwitch = EYPC_PollAndSwitch;
-
- // Prepare the sandbox to handle the window onload function to
- // prevent script errors in IE4
- this.OnReadyStateChange = EYPC_OnReadyStateChange;
- this.window_onload_function = EYPC_OnReadyStateChange;
- this.HandleError = EYPC_HandleError;
-
- this.exit = false;
- this.finalinstall = '';
- this.config = 0;
- this.medium = 'WEB';
- this.numais = 0;
- this.width = 0;
- this.height = 0;
- this.left = 0;
- this.top = 0;
- this.geo = '';
- this.imagepath = '';
-
- // Constants
- this.GEOiXML = 1;
- this.MAINiXML = 2;
- this.PRODiXML = 3;
-
- this.Init = EYPC_Init;
- }
-
- function EYPC_ConvertKBtoMB(val)
- {
- if (EYPC_ConvertKBtoMB.arguments.length != 0)
- {
- var newval = val/100;
- newval = Math.round(newval);
- newval = newval/10;
- if (newval < 1 && document.layers) newval = '0' + newval;
-
- return newval;
- }
- else
- {
- return 0;
- }
- }
-
-
-
-
-
-
-
-
- /*
- Accessory Item Constructor
-
- Input from Developer at design time: key, ver
- Input/Update from control at run time: key, name, description, ver, size, status, restart
- */
- function AI(key, ver)
- {
- this.key = key;
- this.name = '';
- this.sname = '';
- this.description = '';
- this.version = ver;
- this.size = 0;
- this.status = 1; // The default status is 1 which equates to unknown as output from the control
- this.restart = false;
- }
-
- function EYPC_AddAI(key, ver0, ver1)
- {
- switch (EYPC_AddAI.arguments.length)
- {
- // If two arguments were passed in then this does not require separate installs for IE and NN
- case 2:
- this.g_AIs[this.AICount] = new AI(key, ver0);
- this.AICount = this.g_AIs.length;
- break;
-
- // If three argument were passed in then this requires separate versions for IE and NN
- case 3:
- if (document.all) this.g_AIs[this.AICount] = new AI(key + 'IE', ver0);
- else if (document.layers) this.g_AIs[this.AICount] = new AI(key + 'NS', ver1);
- this.AICount = this.g_AIs.length;
- break;
- }
- }
-
-
-
-
-
-
- function AIDEP(key, name, sname, description, version, size, status, restart)
- {
- this.key = key;
- this.name = name;
- this.sname = sname;
- this.description = description;
- this.version = version;
- this.size = size;
- this.status = status;
- this.restart = restart;
- }
-
- function EYPC_AddAIDep(obj)
- {
- this.g_AIDeps[this.AIDepCount] = obj;
- this.AIDepCount = this.g_AIDeps.length;
- }
-
-
-
-
-
-
- function SCREEN(name, content, left, top, zindex, width, height, visibility, backgroundColor, backgroundImage)
- {
- this.backgroundImage = backgroundImage;
- this.backgroundColor = backgroundColor;
- this.visibility = visibility;
- this.height = height;
- this.width = width;
- this.zindex = zindex;
- this.top = top;
- this.left = left;
- this.content = content;
- this.name = name;
- }
-
- function EYPC_AddScreen(obj)
- {
- this.g_Screens[this.ScreenCount] = obj;
- this.ScreenCount = this.g_Screens.length;
- }
-
- function EYPC_ShowScreen(screen)
- {
- dl.SetEltZIndex(dl.GetElt(screen), 1000);
- dl.SetEltVisibility(dl.GetElt(screen), true);
- window.scrollTo(0, 0);
- }
-
- function EYPC_HideScreen(screen)
- {
- dl.SetEltZIndex(dl.GetElt(screen), 0);
- dl.SetEltVisibility(dl.GetElt(screen), false);
- }
-
- function EYPC_SwitchScreens(screen1, screen2)
- {
- this.HideScreen(screen1);
- this.ShowScreen(screen2);
- }
-
-
-
-
-
- // Input to the control: key1#ver1;...
- function EYPC_CheckAIs()
- {
- var sAIs = '';
- var bIsEmpty = false;
-
- if (this.AICount > 0)
- {
-
- for (i=0; i<this.AICount; i++)
- {
- sAIs += this.g_AIs[i].key + '#' + this.g_AIs[i].version + ';';
- }
- }
- sAIs += "MEDIUM='" + this.medium + "'";
-
- pc.PluginsToCheck(sAIs);
-
- if (parseInt(this.AICount) == 0) bIsEmpty = true;
- else bIsEmpty = false;
-
- this.GetAIInfo(bIsEmpty, 4);
- this.GetAIInfo(bIsEmpty, 2);
- this.GetAIInfo(bIsEmpty, 8);
- this.GetAIInfo(bIsEmpty, 16);
- this.GetAIInfo(bIsEmpty, 1);
- }
-
- // Output from the control: key1#name1#description1#ver1#size1#status1#restart_needed;...
- function EYPC_GetAIInfo(isemtpy, type)
- {
- var obj;
-
- this.numais = pc.NumberOfPlugins(type);
-
- // if the isempty flag is true then we are in the CD or EYPC scenario so we need to
- // add all the plugins into the collection
- if (isemtpy)
- {
- for (var i=0; i<this.numais; i++)
- {
- obj = pc.GetPluginUpdateInfo(i, type);
-
- this.AddAI(obj[0], obj[4]);
- this.g_AIs[this.AICount-1].name = obj[1];
- this.g_AIs[this.AICount-1].sname = obj[2];
- this.g_AIs[this.AICount-1].description = obj[3];
- this.g_AIs[this.AICount-1].size = this.ConvertKBtoMB(obj[5]);
- this.g_AIs[this.AICount-1].status = obj[6];
- this.g_AIs[this.AICount-1].restart = obj[7];
- }
- }
- else
- {
- var bIsDep = true;
- var bIsNewDep = true;
- for (var i=0; i<this.numais; i++)
- {
- // assume that the plugin is a dependency
- bIsDep = true;
- // get the object information
- obj = pc.GetPluginUpdateInfo(i, type);
-
- // is it a declared plugin
- for (var d=0; d<this.AICount; d++)
- {
- if (this.g_AIs[d].key == obj[0])
- {
- bIsDep = false;
- this.g_AIs[d].name = obj[1];
- this.g_AIs[d].sname = obj[2];
- this.g_AIs[d].description = obj[3];
- this.g_AIs[d].version = obj[4];
- this.g_AIs[d].size = this.ConvertKBtoMB(obj[5]);
- this.g_AIs[d].status = obj[6];
- this.g_AIs[d].restart = obj[7];
- }
- }
- // if it is not a declared plugin
- if (bIsDep)
- {
- // is it already a captured dependency
- for (var b=0; b<this.AIDepCount; b++)
- {
- // assume that the dependency has not already been added
- bIsNewDep = true;
- if (this.g_AIDeps[b].key == obj[0])
- {
- bIsNewDep = false;
- }
- }
- // if it is not already a dependency and need to be installed
- // then add it to the collection
- if ((bIsNewDep) && ((obj[6] != 8) || (obj[6] != 16)))
- {
- this.AddAIDep(new AIDEP(obj[0], obj[1], obj[2], obj[3], obj[4], this.ConvertKBtoMB(obj[5]), obj[6], obj[7]));
- }
- }
- }
- }
- }
-
- // Input to the control: key1;key2;...
- function EYPC_InstallAIs()
- {
- pc.InstallPlugins(this.config, this.finalinstall);
- }
-
- function EYPC_HandleError()
- {
- return true;
- }
-
- function EYPC_OnReadyStateChange()
- {
- if (document.readyState == 'complete') eypc.window_onload_function();
- }
-
- function EYPC_DefineScreens(config)
- {
- this.left = 0;
- this.top = 50;
- this.width = '480';
- this.height = '100%';
- var sContent = '';
-
- var sHTML = '';
- var zindex = 1;
- ////////////////////////////////////////////////////
- // Name: shInstallWTMScr
- // Equip Your PC Spec: Get Application (41W)
- ////////////////////////////////////////////////////
- sHTML = '';
- if (this.config == 1)
- {
- sHTML += '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>' +
- BBLACKFONT +
- '<b>' + SHINSTALLWTMSCR_MSG6 + '</b>' +
- '<br><br>' +
- SHINSTALLWTMSCR_MSG7 +
- '<br><br>' +
- SHINSTALLWTMSCR_MSG8 +
- EFONT +
- '</td></tr><tr><td><img src="' + this.imagepath + 'spacer.gif" height="20" width="10"></td></tr>';
- }
- else
- {
- sHTML += '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>' +
- BBLACKFONT + '<b>' + SHINSTALLWTMSCR_MSG0 + '</b>' +
- '<br><br>' +
- SHINSTALLWTMSCR_MSG1 +
- '<br><br>' +
- SHINSTALLWTMSCR_MSG2 +
- '<br><br>' +
- '<b>' + SHINSTALLWTMSCR_MSG3 + '</b>' + '2.2 MB' +
- '<br>' +
- '<b>' + SHINSTALLWTMSCR_MSG4 + '</b>' + '13 ' + SHINSTALLWTMSCR_MSG5 + ' 28.8 kbps' + EFONT +
- '</td></tr><tr><td><img src="' + this.imagepath + 'spacer.gif" height="20" width="10"></td></tr>';
- }
-
- if (!ti.install_inprocess) sHTML += '<tr><td><img src="' + this.imagepath + 'spacer.gif" height="1" width="189">' +
- '<a href="javascript:ti.Install();"><IMG SRC="' + this.imagepath + '(41)w_button_install_now_t.gif" border="0"></a>' +
- '</td></tr>';
-
- sHTML += '</table>';
- this.AddScreen(new SCREEN('shInstallWTMScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Name: shUpdateWTMScr
- // Equip Your PC Spec: Update Application (72W)
- ////////////////////////////////////////////////////
- sHTML = '';
- sHTML += '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>' +
- BBLACKFONT + '<b>' + SHUPDATEAVAILABLESCR_MSG0 + '</b>' +
- '<br><br>' +
- SHUPDATEAVAILABLESCR_MSG1 +
- '<br><br>' +
- '<b>' + SHUPDATEAVAILABLESCR_MSG2 + '</b>' + '0.5 MB' +
- '<br>' +
- '<b>' + SHUPDATEAVAILABLESCR_MSG3 + '</b>' + '13 ' + SHUPDATEAVAILABLESCR_MSG4 + ' 28.8 kbps' + EFONT +
- '</td></tr><tr><td><img src="' + this.imagepath + 'spacer.gif" height="20" width="10"></td></tr>';
-
- if (!ti.install_inprocess) sHTML += '<tr><td><img src="' + this.imagepath + 'spacer.gif" height="1" width="189">' +
- '<a href="javascript:ti.Install();"><IMG SRC="' + this.imagepath + '72w_button_update_now_t.gif" border="0"></a>' +
- '</td></tr>';
-
- sHTML += '</table>';
- this.AddScreen(new SCREEN('shUpdateWTMScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Name: shWaitToUpdateScr
- // Equip Your PC Spec: Wait to Update (74W)
- ////////////////////////////////////////////////////
- sHTML = '';
- sHTML += '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>' +
- BBLACKFONT + '<b>' + SHWAITTOUPDATESCR_MSG0 + '</b>' +
- '<br><br>' +
- SHWAITTOUPDATESCR_MSG1 +
- '</td></tr><tr><td><img src="' + this.imagepath + 'spacer.gif" height="20" width="10"></td></tr>';
-
- sHTML += '</table>';
- this.AddScreen(new SCREEN('shWaitToUpdateScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Name: shBusyInstallingScr
- // Equip Your PC Spec: Installation in Progress (73W)
- ////////////////////////////////////////////////////
- sHTML = '';
- sHTML += '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>' +
- BBLACKFONT + '<b>' + SHBUSYINSTALLINGSCR_MSG0 + '</b>' +
- '<br><br>' +
- SHBUSYINSTALLINGSCR_MSG1 +
- '</td></tr><tr><td><img src="' + this.imagepath + 'spacer.gif" height="20" width="10"></td></tr>';
-
- sHTML += '</table>';
- this.AddScreen(new SCREEN('shBusyInstallingScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Name: shInstallAIsScr
- // Equip Your PC Spec: Scan Results Page (14W)
- ////////////////////////////////////////////////////
- var msg = new Array();
- var obj;
- msg[0] = BBLACKFONT + SHINSTALLAISSCR_STATUS0 + EFONT;
- msg[1] = BBLACKFONT + SHINSTALLAISSCR_STATUS1 + EFONT;
- msg[2] = BBLUEFONT + SHINSTALLAISSCR_STATUS2 + EFONT;
- msg[4] = BREDFONT + SHINSTALLAISSCR_STATUS3 + EFONT;
- msg[8] = BBLACKFONT + SHINSTALLAISSCR_STATUS4 + EFONT;
- msg[16] = BBLACKFONT + SHINSTALLAISSCR_STATUS5 + EFONT;
-
- sHTML = '';
-
- // Display initial text and select all checkbox
- sHTML += '<form id="shSelectAIsFrm" name="shSelectAIsFrm">' +
- '<table name="top" cellspacing="0" cellpadding="0" border="0" width="100%">' +
- '<tr>' +
- '<td>' +
- BBLACKFONT +
- '<b>' +
- SHINSTALLAISSCR_MSG0 +
- '</b><br><br>' +
- SHINSTALLAISSCR_MSG1 +
- '<br>' +
- EFONT +
- '</td>' +
- '<td>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="52" width="1" border="0"><br>' +
- '<a href="javascript:eypc.BtnContinue()">' +
- '<img src="' + this.imagepath + '(14)w_button_continue_t.gif" border="0"></a>' +
- '</td>' +
- '<td>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '</table>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="15" width="1" border="0">' +
- '<table name="top" cellspacing="0" cellpadding="0" border="0" width="268">' +
- '<tr>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="2" border="0">' +
- '<input id="shChkSelectAll" name="shChkSelectAll" type="checkbox" onclick="eypc.SelectAllAI();"><br>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="27" border="0">' +
- '</td>' +
- '<td align="left" width="100%">' + BBLACKFONT + '<b>' + SHINSTALLAISSCR_MSG2 + '</b>' + EFONT + '</td>' +
- '<td align="right" width="1%" nowrap>';
-
- sHTML += '</td>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '</table><br>';
-
- // Get the accessory item information
- for (var i=0; i<this.AICount; i++)
- {
- obj = this.g_AIs[i];
- {
- sHTML += '<table cellspacing="0" cellpadding="0" border="0" width="100%">' +
- '<tr>' +
- '<td align="left" width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="2" border="0">' +
- '<input id="ai" name="ai" type="checkbox" value="' + obj.key + '" onclick="eypc.ChkUpdateTotalSize(\'' + obj.key + '\', ' + obj.size + ');"><br>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="27" border="0">' +
- '</td>' +
- '<td align="left" height="20" width="100%" nowrap>' +
- BBLUEFONT + '<b>' + obj.sname + '</b>' + EFONT +
- '</td>' +
- '<td align="right" height="20" width="100%" nowrap>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="27" border="0">' +
- BBLACKFONT + '<b>' + msg[obj.status] + '</b>' + EFONT +
- '</td>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td align="left" valign="top" width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="27" border="0">' +
- '</td>' +
- '<td align="left" width="100%">' +
- BBLACKFONT + '<b>' + obj.name + '</b>' + EFONT +
- '</td>' +
- '<td align="right" width="1%" nowrap>' +
- BBLACKFONT + SHINSTALLAISSCR_MSG5 + obj.size + ' MB' + '' + EFONT +
- '</td>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td align="left" valign="top">' +
- ' ' +
- '</td>' +
- '<td align="left" valign="top" colspan="2" width="100%">' +
- BBLACKFONT + obj.description + EFONT;
-
- if (obj.restart == 1)
- {
- sHTML += '</td>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td colspan="4" valign="top">' +
- '<img src="' + this.imagepath + '(14)w_pc_restart_t.gif"> ' +
- '<span style="font-family:Verdana; font-size:11px">' +
- SHINSTALLAISSCR_MSG4 +
- '</span>' +
- '</td>' +
- '</tr>';
- }
- else
- {
- sHTML += '</td>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>';
- }
-
- sHTML += '</table>' +
- '<img src="' + this.imagepath + 'spacer.gif" height="20" width="20" border="0">';
- }
- }
-
- // Add the back to top link
- sHTML += '<table cellpading="0" cellspacing="0" border="0" width="100%">' +
- '<tr><td align="right" width="100%">' +
- '<a href="javascript:eypc.BtnContinue()">' +
- '<img src="' + this.imagepath + '(14)w_button_continue_t.gif" border="0"></a>' +
- '</td>' +
- '<td width="1%">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr><td align="left" width="100%">' +
- BBLACKFONT +
- SHINSTALLAISSCR_MSG6 +
- EFONT +
- '</td>' +
- '</tr>' +
- '</table>' +
- '</form>';
-
- sContent = '<table cellpading="0" cellspacing="0" border="0" width="100%"><tr><td align="right">' +
- BBLACKFONT + '<b>' + SHINSTALLAISSCR_MSG3 + '</b> 0 MB' + EFONT + '</td></tr></table>';
- sHTML += dl.CreateElt('shAITotalSize', sContent, 268, 106, 1001, 200, 20, 'inherit', false, false);
- this.AddScreen(new SCREEN('shInstallAIsScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Name: shConfirmInstallAIsScr
- // Equip Your PC Spec: Confirm Install page (17W)
- ////////////////////////////////////////////////////
- sHTML = '';
- sHTML += '<table cellspacing="0" cellpadding="0" border="0" width="100%">' +
- '<tr>' +
- '<td width="100%" height="80">' +
- BBLACKFONT +
- '<b>' + SHCONFIRMINSTALLAISSCR_MSG0 + '</b>' +
- '<br><br>' +
- SHCONFIRMINSTALLAISSCR_MSG1 +
- '<br>' +
- SHCONFIRMINSTALLAISSCR_MSG2 +
- '<br><br>' +
- BBLACKFONT + SHCONFIRMINSTALLAISSCR_MSG7 + EFONT +
- '<br><br></td>' +
- '<td width="1%" height="80" align="right">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td align="right" width="100%" colspan="2">' +
- '<a href="javascript:eypc.BtnGoBack()">' +
- '<img src="' + this.imagepath + '(17)w_button_goback_t.gif" border="0"></a>' +
- '<a href="javascript:eypc.BtnStartInstall()">' +
- '<img src="' + this.imagepath + '(17)w_button_installnow_t.gif" border="0"></a>' +
- '</td>' +
- '</tr></table>';
- this.AddScreen(new SCREEN('shConfirmInstallAIsScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Name: shInstallInProcessScr
- // Equip Your PC Spec: Marketing Message (48W)
- ////////////////////////////////////////////////////
- sHTML = '';
- sHTML += '<table cellspacing="0" cellpadding="0" border="0" width="100%">' +
- '<tr>' +
- '<td width="100%">' +
- BBLACKFONT +
- '<b>' + SHINSTALLINPROCESSSCR_MSG0 + '</b>' +
- '<br><br>' +
- SHINSTALLINPROCESSSCR_MSG1 +
- '<br><br>' +
- '<b>' + SHINSTALLINPROCESSSCR_MSG2 + '</b>' +
- '<br>' +
- SHINSTALLINPROCESSSCR_MSG3 +
- '<br><br>' +
- '<b>' + SHINSTALLINPROCESSSCR_MSG4 + '</b>' +
- '<br>' +
- SHINSTALLINPROCESSSCR_MSG5 +
- EFONT +
- '</td>' +
- '<td width="1%" align="right">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '</table>';
- this.AddScreen(new SCREEN('shInstallInProcessScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
-
- ////////////////////////////////////////////////////
- // Create the Hang On Text screen
- // Name: shInstallWTMInProcessScr
- // Equip Your PC Spec: Hang on Text (56W)
- ////////////////////////////////////////////////////
- sHTML = '';
- if (this.config == 1)
- {
- sHTML += '<table cellspacing="0" cellpadding="0" border="0" width="100%">' +
- '<tr>' +
- '<td width="100%">' +
- BBLACKFONT +
- '<b>' + SHINSTALLWTMINPROCESSSCR_MSG0 + '</b>' +
- '<br>' +
- SHINSTALLWTMINPROCESSSCR_MSG2 +
- EFONT +
- '</td>' +
- '</tr>' +
- '</table>';
- }
- else
- {
- sHTML += '<table cellspacing="0" cellpadding="0" border="0" width="100%">' +
- '<tr>' +
- '<td width="100%">' +
- BBLACKFONT +
- '<b>' + SHINSTALLWTMINPROCESSSCR_MSG0 + '</b>' +
- '<br>' +
- SHINSTALLWTMINPROCESSSCR_MSG1 +
- '</td>' +
- '</tr>' +
- '</table>';
- }
- this.AddScreen(new SCREEN('shInstallWTMInProcessScr', sHTML, this.left, this.top, zindex, this.width, this.height, 'hidden', false, false));
-
- if (!this.exit)
- {
- var obj;
-
- for (var i=0; i<this.ScreenCount; i++)
- {
- obj = this.g_Screens[i];
- dl.DrawElt(obj.name, obj.content, obj.left, obj.top, obj.zindex, obj.width, obj.height, obj.visibility, obj.backgroundColor, obj.backgroundImage);
- this.HideScreen(obj.name);
- }
- }
-
- }
-
-
-
-
-
-
-
- /*
- Functions used to handle forms
- */
- function EYPC_IsInInstallString(obj, str)
- {
- var strobj = str.split(';');
- var bReturn = false;
-
- for (var i=0; i<strobj.length; i++)
- {
- if (obj[0] == strobj[i])
- {
- bReturn = true;
- break;
- }
- }
-
- return bReturn;
- }
-
- function EYPC_BtnContinue()
- {
- var sHTML = ''; // Holder of HTML that we are going to write to the screen
- var sHTML_Sel = ''; // Holder of the HTML for the tools that were selected for installation
- var sHTML_Req = ''; // Holder of the HTML for the tools that we have to install because they are dependencies
- var sAIs = ''; // The list of tools to send to the pluginchecker
- var sAIsSent = ''; // A holder for sAIs
- var nTotalSize = 0; // The total install size of all tools that we have to install
- var nAIs = 0; // Number of tools we have to install
- var i = 0;
- var obj; // Object returned when we ask for UpdateInfo on it
- var scr; // Object pointer to the layer we are going to write the HTML to
- var frm; // The form that we are pulling the selected tools from
-
- if (document.layers) frm = document.layers['shInstallAIsScr'].document.forms['shSelectAIsFrm'];
- else if (document.all) frm = document.forms['shSelectAIsFrm'];
-
- // Perform a final check for dependencies
- for (i=0; i<frm.ai.length; i++)
- {
- if (frm.ai[i].checked)
- {
- if (sAIs == '') sAIs += frm.ai[i].value;
- else sAIs += ';' + frm.ai[i].value;
- }
- }
-
- if (sAIs == '') alert(SHCONFIRMINSTALLAISSCR_MSG3);
- else
- {
- /* Send the tools that were selected to the pluginchecker and find out the number of tools we have to install */
- nAIs = pc.SetSelectedPlugins(sAIs, true);
-
- sAIsSent = sAIs;
- sAIs = '';
-
- for (i=0; i<nAIs; i++)
- {
- obj = pc.GetPluginUpdateInfo(i);
-
- if (!this.IsInInstallString(obj, sAIsSent))
- {
- // If the status on the software is unknown(0), unable to determine(1),
- // not installed(2), or update available(4) then we need to display it
- if (obj[6] == 0 || obj[6] == 1 || obj[6] == 2 || obj[6] == 4)
- {
- sHTML_Req += '<tr>' +
- '<td width="100%">' +
- BBLUEFONT + '<b>' + obj[2] + '</b>' + EFONT +
- '<br>' +
- BBLACKFONT + '<b>' + obj[1] + '</b>' + EFONT +
- '</td>' +
- '<td width="1%" align="right" valign="bottom" nowrap>' +
- BBLACKFONT + SHINSTALLAISSCR_MSG5 + this.ConvertKBtoMB(obj[5]) + ' MB' + EFONT +
- '</td>' +
- '<td>' + '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td colspan="3">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="18" width="1" border="0">' +
- '</td>' +
- '</tr>';
- }
- }
- else
- {
- sHTML_Sel += '<tr>' +
- '<td width="100%">' +
- BBLUEFONT + '<b>' + obj[2] + '</b>' + EFONT +
- '<br>' +
- BBLACKFONT + '<b>' + obj[1] + '</b>' + EFONT +
- '</td>' +
- '<td width="1%" align="right" valign="bottom" nowrap>' +
- BBLACKFONT + SHINSTALLAISSCR_MSG5 + this.ConvertKBtoMB(obj[5]) + ' MB' + EFONT +
- '</td>' +
- '<td>' + '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td colspan="3">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="18" width="1" border="0">' +
- '</td>' +
- '</tr>';
- }
-
- // If the status on the software is unknown(0), unable to determine(1),
- // not installed(2), or update available(4) then we need to include it
- // in the total size
- if (this.IsInInstallString(obj, sAIsSent))
- {
- nTotalSize += parseFloat(this.ConvertKBtoMB(obj[5]));
- sAIs += obj[0] + ';';
- }
- else
- {
- if (obj[6] == 0 || obj[6] == 1 || obj[6] == 2 || obj[6] == 4)
- {
- sAIs += obj[0] + ';';
- nTotalSize += parseFloat(this.ConvertKBtoMB(obj[5]));
- }
- }
- }
- // Make the value that is being shown the same as was displayed
- // when the user was selecting software tools
- nTotalSize = nTotalSize*10;
- nTotalSize = Math.round(nTotalSize);
- nTotalSize = nTotalSize/10;
-
- /* Find the confirm screen and add it's content */
- for (iLoop=0; iLoop<this.g_Screens.length; iLoop++)
- {
- if (this.g_Screens[iLoop].name == 'shConfirmInstallAIsScr')
- {
- sHTML += this.g_Screens[iLoop].content;
- break;
- }
- }
-
- sHTML += '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>' +
- '<td align="right" width="100%" height="27" valign="bottom">' +
- BBLACKFONT +
- '<b>' + SHCONFIRMINSTALLAISSCR_MSG4 + ' </b>' + nTotalSize + ' MB' +
- EFONT +
- '</td>' +
- '<td width="1%" align="right">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="1" width="13" border="0">' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td colspan="2" height="30" width="100%"> ' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td colspan="2" height="20" width="100%">' +
- BBLACKFONT + '<b>' + SHCONFIRMINSTALLAISSCR_MSG5 + '</b>' + EFONT +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td colspan="2">' +
- '<img src="' + this.imagepath + 'spacer.gif" height="8" width="1" border="0">' +
- '</td>' +
- '</tr>' +
- '</table>' +
- '<table cellspacing="0" cellpadding="0" width="100%" border="0">' +
- sHTML_Sel +
- '<tr>' +
- '<td width="100%" colspan="3">' + '<img src="' + this.imagepath + 'spacer.gif" height="15" width="1" border="0">' +
- '</td>' +
- '</tr>';
- if (sHTML_Req != '')
- {
- sHTML += '<tr>' +
- '<td width="100%" colspan="3">' + '<span style="font-family:Verdana; font-size:11px">' +
- SHCONFIRMINSTALLAISSCR_MSG6 + '</span>' + '</td>' +
- '</tr>' +
- '<tr>' +
- '<td width="100%" colspan="3">' + '<img src="' + this.imagepath + 'spacer.gif" height="10" width="1" border="0">' +
- '</td>' +
- '</tr>' +
- sHTML_Req;
- }
-
- sHTML += '</table>';
- this.finalinstall = sAIs + "MEDIUM='" + this.medium + "'";
-
- scr = dl.GetElt('shConfirmInstallAIsScr');
- if (document.layers)
- {
- scr.document.open();
- scr.document.write(sHTML);
- scr.document.close();
- }
- else if (document.all)
- {
- scr.innerHTML = sHTML;
- }
-
- this.SwitchScreens('shInstallAIsScr', 'shConfirmInstallAIsScr');
- }
- }
-
- function EYPC_SelectAllAI()
- {
- var ctl;
- var frm;
- var bState;
- var sContent;
-
- if (document.layers) ctl = document.layers['shInstallAIsScr'].document.layers['shAITotalSize'].document;
- else if (document.all) ctl = document.all['shAITotalSize'];
-
- if (document.layers) frm = document.layers['shInstallAIsScr'].document.forms['shSelectAIsFrm'];
- else if (document.all) frm = document.forms['shSelectAIsFrm'];
-
- if (EYPC_SelectAllAI.arguments.length == 1)
- {
- frm.shChkSelectAll.checked = false;
- for (var i=0; i<frm.ai.length; i++)
- {
- for (var j=0; j<this.AICount; j++)
- {
- if (frm.ai[i].value == this.g_AIs[j].key)
- {
- frm.ai[i].checked = false;
- g_shTotalSize -= parseFloat(this.g_AIs[j].size);
- if(g_shTotalSize < 0) g_shTotalSize -= g_shTotalSize;
- }
- }
- }
- }
-
- if (frm.shChkSelectAll.checked) bState = true;
- else bState = false;
-
- for (var i=0; i<frm.ai.length; i++)
- {
- for (var j=0; j<this.AICount; j++)
- {
- if (frm.ai[i].value == this.g_AIs[j].key)
- {
- if (this.g_AIs[j].status == 2)
- {
- if (bState)
- {
- if (!frm.ai[i].checked)
- {
- frm.ai[i].checked = bState;
- g_shTotalSize += parseFloat(this.g_AIs[j].size);
- }
- }
- else
- {
- frm.ai[i].checked = bState;
- g_shTotalSize -= parseFloat(this.g_AIs[j].size);
- if(g_shTotalSize < 0) g_shTotalSize -= g_shTotalSize;
- }
- }
- break;
- }
- }
- }
-
- /*
- for (var i=0; i<this.AICount; i++)
- {
- if (this.g_AIs[i].status == 2)
- {
- if (bState) g_shTotalSize += parseFloat(this.g_AIs[i].size);
- else g_shTotalSize -= parseFloat(this.g_AIs[i].size);
- }
- }
- */
- g_shTotalSize = g_shTotalSize*10;
- g_shTotalSize = Math.round(g_shTotalSize);
- g_shTotalSize = g_shTotalSize/10;
-
- sContent = '<table cellpading="0" cellspacing="0" border="0" width="100%"><tr><td align="right">' +
- BBLACKFONT + '<b>' + SHINSTALLAISSCR_MSG3 + '</b> ' + g_shTotalSize + ' MB' + EFONT + '</td></tr></table>';
-
- if (document.layers)
- {
- ctl.open();
- ctl.write(sContent);
- ctl.close();
- }
- else if (document.all)
- {
- ctl.innerHTML = sContent;
- }
- }
-
- function EYPC_ChkUpdateTotalSize(key, size)
- {
- var ctl;
- var frm;
- var sContent = '';
-
- if (document.layers) ctl = document.layers['shInstallAIsScr'].document.layers['shAITotalSize'].document;
- else if (document.all) ctl = document.all['shAITotalSize'];
-
- if (document.layers) frm = document.layers['shInstallAIsScr'].document.forms['shSelectAIsFrm'];
- else if (document.all) frm = document.forms['shSelectAIsFrm'];
-
- for (var i=0; i<frm.ai.length; i++)
- {
- if (frm.ai[i].value == key)
- {
- if (frm.ai[i].checked) g_shTotalSize += size;
- else
- {
- frm.shChkSelectAll.checked = false;
- g_shTotalSize -= size;
- }
- }
- }
-
- g_shTotalSize = g_shTotalSize*10;
- g_shTotalSize = Math.round(g_shTotalSize);
- g_shTotalSize = g_shTotalSize/10;
-
- sContent = '<table cellpading="0" cellspacing="0" border="0" width="100%"><tr><td align="right">' +
- BBLACKFONT + '<b>' + SHINSTALLAISSCR_MSG3 + '</b> ' + g_shTotalSize + ' MB' + EFONT + '</td></tr></table>';
-
- if (document.layers)
- {
- ctl.open();
- ctl.write(sContent);
- ctl.close();
- }
- else if (document.all)
- {
- ctl.innerHTML = sContent;
- }
- }
-
- function EYPC_BtnGoBack()
- {
- this.SwitchScreens('shConfirmInstallAIsScr', 'shInstallAIsScr');
- }
-
- function EYPC_BtnStartInstall()
- {
- this.SwitchScreens('shConfirmInstallAIsScr', 'shInstallInProcessScr');
- eypc.InstallAIs();
- }
-
- function EYPC_PollAndSwitch(scr1, scr2)
- {
- if (pc.IsWOTKInstallerRunning()) setTimeout('eypc.PollAndSwitch("' + scr1 + '", "' + scr2 + '")', 3000);
- else this.SwitchScreens(scr1, scr2);
- }
-
- /*
- Sandbox Handler Initialization
-
- Need to determine the UI to use.
- */
- function EYPC_Init()
- {
- // Initialize any components that require it
- ti.Init(this.config);
- wtui.Init();
- tu.Init();
-
- this.imagepath = g_sTKMRoot + 'scenarios/eypc/' + g_sGeo + '/';
-
- var bInstallRequired = true;
- var sCurrentMedium = 'WEB';
-
- // Do we continue processing?
- if (!this.exit)
- {
- // Initialize the control with the AIs that we need
- if (ti.status == ti.INSTALLED)
- {
- pc.Init();
- this.CheckAIs();
- }
-
- // Create the screens needed for the scenario, this method is attached and defined
- // by the scenario javascript file
- this.DefineScreens();
-
- // Start with the appropriate screen
- // The shInstallWTMScr screen always has install instructions for the Updater Service
- // The shInstallAIsScr screen begins the installation of software tools
- if (ti.install_inprocess)
- {
- ti.Install();
- this.ShowScreen('shInstallWTMInProcessScr')
- }
- else
- {
- if (bInstallRequired)
- {
- if (ti.status == ti.NOT_INSTALLED) this.ShowScreen('shInstallWTMScr');
- else if (ti.status == ti.UPDATE_REQ)
- {
- // If the app is running then we are going to assume that the install was kicked off from the CD
-
- if(document.layers)
- {
- pc.Init();
- if (pc.IsWOTKInstallerRunning())
- {
- this.ShowScreen('shWaitToUpdateScr');
- setTimeout('eypc.PollAndSwitch("' + 'shWaitToUpdateScr' + '", "' + 'shUpdateWTMScr' + '")', 3000);
- }
- else this.ShowScreen('shUpdateWTMScr');
- }
- else if(document.all)
- {
- if (tu.IsTKMFileInUse('WOTKINSTALLUI2.exe') == 'YES')
- {
- this.ShowScreen('shWaitToUpdateScr');
- setTimeout('eypc.PollAndSwitch("' + 'shWaitToUpdateScr' + '", "' + 'shUpdateWTMScr' + '")', 3000);
- }
- else this.ShowScreen('shUpdateWTMScr');
- }
- }
- else if (ti.status == ti.PATCH_REQ)
- {
- ti.Install();
- }
- else if (ti.status == ti.INSTALLED)
- {
- // We cannot let an install take place if the mediums do not match
- if (wtui.GetInstallMedium() == 1) sCurrentMedium = 'CD';
-
- if (pc.IsWOTKInstallerRunning() && (this.medium != sCurrentMedium))
- {
- this.ShowScreen('shBusyInstallingScr');
- setTimeout('eypc.PollAndSwitch("' + 'shBusyInstallingScr' + '", "' + 'shInstallAIsScr' + '")', 3000);
- }
- else this.ShowScreen('shInstallAIsScr');
- }
- }
- else this.ShowScreen('shNoInstallRequiredScr');
- }
-
- // This is a patch for IE4 only, the browser does not handle the content of the sandbox
- // at the same time the the dhtml is running and generates errors.
- // if there is a window onload function capture it, clear it, and re-assign it
- if ((window.onload) && (document.all))
- {
- this.window_onload_function = window.onload;
- window.onload = '';
- document.onreadystatechange = this.OnReadyStateChange;
- }
- }
- }
-
-
- /* Create this scripts main object */
- var eypc = new EYPC();
-
-
- /* Override window events */
- window.onerror = eypc.HandleError; // now we catch all the script errors
-
-
- /* Global variables */
- var g_shTotalSize = 0;
-
-
- /* Constants */
- var BREDFONT = '<font face="Verdana" size="2" color="#ff0000">';
- var BBLUEFONT = '<font face="Verdana" size="2" color="#0000ff">';
- var BBLACKFONT = '<font face="Verdana" size="2" color="#000000">';
- var EFONT = '</font>';
- //--></script>